﻿var MainModel = new Vue({
    el: "#app",
    data: {
        showGood: false,
        showPoint: false,
        showOrder: false
    },
    methods: {
        init:function() {
            var self = this;
            self.showGood = true;
            self.showPoint = false;
            self.showOrder = false;
        },
        viewGood:function() {
            var self = this;
            self.showGood = true;
            self.showPoint = false;
            self.showOrder = false;
        },
        viewPoint:function() {
            var self = this;
            self.showGood = false;
            self.showPoint = true;
            self.showOrder = false;
        },
        viewOrder:function() {
            var self = this;
            self.showGood = false;
            self.showPoint = false;
            self.showOrder = true;
        },
        order: function (id, openid) {
            this.showLoading();
            window.location.href = "http://www.qianjing-china.com/thousandClear/Shop/MarketOrder/Index/" + id + "?openid=" + openid;
        },
        prod: function (id, openid) {
            this.showLoading();
            window.location.href = "http://www.qianjing-china.com/thousandClear/Shop/Product/Index/" + id + "?openid=" + openid;
        },
        showLoading:function() {
            $('#loading').addClass('show');
        }
    }
});

$(document).ready(function() {
    MainModel.init();
});